file(GLOB  SRC_FILES_ODE
    "*.f90"
)

set(sources-ode-fpp
    module_ode_solver_abstract.fpp
    module_ode_rk.fpp
    module_ode_euler.fpp
    )

fypp_preprocess("${sources-ode-fpp}" sources-ode-postfpp)
message(${sources-ode-postfpp})
set(ODEPACK_SRC_FILES ${SRC_FILES_ODE} CACHE STRING INTERNAL)

set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/odepack)
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_SOURCE_DIR}/include/odepack)
add_library(odepack ${ODEPACK_SRC_FILES} ${sources-ode-postfpp})
target_link_libraries(odepack PkgConfig::fortran_stdlib PkgConfig::PETSC petsc_wrapper)
target_include_directories(odepack PUBLIC ${PROJECT_SOURCE_DIR}/include/odepack)

